package com.datoucai.mapper;

import com.datoucai.entity.CommentEntity;
import com.datoucai.entity.CommentParam;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CommentMapper {

	/**
	 * 插入评论
	 * @param entity
	 * @return
	 */
	int addComment(CommentEntity entity);

	/**
	 * 删除评论
	 * @param id
	 * @return
	 */
	int deleteCommentById(Long id);

	/**
	 * 逻辑删除
	 * @param param
	 * @return
	 */
	int updateByParam(CommentParam param);

	/**
	 * 查询评论
	 * @return
	 */
	List<CommentEntity> queryCommentByParam(CommentParam param);

	/**
	 * 查询评论总数
	 * @return
	 */
	int countCommentByParam(CommentParam param);
}
